import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import path from 'path'
// https://vitejs.dev/config/
export default defineConfig({
  server: {
    // host:'localhost',
    // port:8080,
    proxy: {
      '/matter': {
        target: 'https://www.teda.gov.cn/#/',
        changeOrigin: true,
       //secure:true,
        ws: false, // 需要websocket 开启
        rewrite: (path) => path.replace(/^\/matter/, '/matter')
      },
      ///app
      '/app': {
        target: 'https://www.teda.gov.cn/#/',
        changeOrigin: true,
       //secure:true,
        ws: false, // 需要websocket 开启
        rewrite: (path) => path.replace(/^\/app/, '/app')
      },
    }
  },
  plugins: [vue()],
  define: {
    __VUE_PROD_DEVTOOLS__: true,
  },
  resolve: {
    alias: {
      '@': path.resolve(__dirname, './src')
    }
  }
})
